hysop.tools.numpywrappers module

Interface to numpy arrays, with hysop predifined types for int, real …

Those functions are useful to enforce hysop predefined types in numpy arrays.

hysop.tools.numpywrappers.fancy_print(a, replace_values={}, replace_views={}, element_width=6, inital_val=None, **print_opts)[source]

Print values with ghosts replaced by symbol. Mainly for debug purposes.

Parameters:
  • a (np.ndarray) – Array to be printed.

  • replace_values (dict, optional) – Replace value matching key predicate by value in array. Predicates take the array as parameter. Values can be any printable object.

  • replace_views (dict, optional) – Replace each key view by value in array. Values can be any printable object.

  • element_width (int, optional) – String width of the printed array values.

  • inital_val (object, optional) – Initially fill the new array with given val. If specified, new array won’t be initialized by input array.

  • print_opts

    Numpy printing options. Default options are:

    threshold = 10k linewidth = 1k nanstr = ‘nan’ infstr = ‘inf’ formatter = custom formatter

hysop.tools.numpywrappers.ndindex_with_ghosts(shape, ghosts)[source]
hysop.tools.numpywrappers.set_readonly(*args)[source]
hysop.tools.numpywrappers.slices_empty(slices, shape)[source]